package com.mipo.observer;
import java.util.Date;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
	public static void main(String[] args) throws Exception {
        ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"classpath:spring.xml"});
//        Abc taskPublisher = ctx.getBean(Abc.class);
//        taskPublisher.say();
        
        TaskPublisher taskPublisher = ctx.getBean(TaskPublisher.class);
        SyncTask task = new SyncTask();
        task.setStat(1);
        task.setcNum(3);
        System.out.println(new Date().toLocaleString() + "com.mipo.observer.Main init...");
        taskPublisher.publishEvent(task);
        System.out.println(new Date().toLocaleString() + "com.mipo.observer.Main end...");
        Thread.sleep(999999999);
	}
}
